﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DDZAnimation : MonoBehaviour {


    public UISprite spritAni;
    public int count;
    private void Start()
    {
        StartCoroutine(DoAnimation());
    }

    IEnumerator DoAnimation()
    {
        for (int i = 1; i <= count; i++)
        {
            spritAni.spriteName = i.ToString();
            spritAni.width = spritAni.GetAtlasSprite().width;
            spritAni.height = spritAni.GetAtlasSprite().height;
            yield return new WaitForSeconds(0.07f);
            

        }
        Destroy(gameObject);
    }
}
